import request from '@/router/axios';

//获取echarts饼图
export const populationTypeStructure = (deptId) => {
  return request({
    url: '/api/smart-xapply/gis/populationTypeStructure',
    method: 'post',
    params:{
      deptId
    }
  })
}

//获取网格信息
export const getGridBaseCount = (gridId) => {
  return request({
    url: '/api/smart-xapply/gis/getGridBaseCount',
    method: 'post',
    params:{
      gridId
    }
  })
}

//获取查询筛选条件数据
//flag:nation, sys_population_type, education, religion, party, types_of_key_personnel
export const codeList = (dictType) => {
  return request({
    url: '/api/smart-xapply/gis/codeList',
    method: 'post',
    params: {
      dictType
    }
  })
}

export const getWorkerStructure = (gridId) => {
  return request({
    url: '/api/smart-xapply/gis/getWorkerStructure',
    method: 'get',
    params: {
      gridId
    }
  })
}

//获取特殊人群echarts饼图
export const getSpecialCount = (gridId) => {
  return request({
    url: '/api/smart-xapply/gis/getSpecialCount',
    method: 'post',
    params: {
      gridId
    }
  })
}

//获取网格员列表数据
export const workerList = (data) => {
  return request({
    url: '/api/smart-xapply/gis/workerList',
    method: 'post',
    params: data
  })
}

//获取简介内容
export const gridBrief = (gridId) => {
  return request({
    url: '/api/smart-xapply/gis/gridBrief',
    method: 'get',
    params: {
      gridId
    }
  })
}

//获取重点关注人群统计与分布数据
export const focusYearChange = (gridId,type) => {
  return request({
    url: '/api/smart-xapply/gis/focusYearChange',
    method: 'get',
    params: {
      gridId,type
    }
  })
}

export const focusCountByGridId = (gridId,type) => {
  return request({
    url: '/api/smart-xapply/gis/focusCountByGridId',
    method: 'get',
    params: {
      gridId,type
    }
  })
}

//搜索数据,人员列表
export const peopleList = (data) => {
  return request({
    url: '/api/smart-xapply/gis/peopleList',
    method: 'post',
    params: data
  })
}

//获取房屋详情信息
export const getHouseAndBuildingInfo = (houseId) => {
  return request({
    url: '/api/smart-xapply/gis/getHouseAndBuildingInfo',
    method: 'post',
    params: {
      houseId
    }
  })
}


export const houseDetail = (houseId) => {
  return request({
    url: '/api/smart-xapply/gis/houseDetail',
    method: 'get',
    params: {
      houseId
    }
  })
}

//获取人员同户关系列表
export const getFamilyRelationList = (houseNo) => {
  return request({
    url: '/api/smart-xapply/gis/getFamilyRelationList',
    method: 'post',
    params: {
      houseNo
    }
  })
}

//获取人员同住关系列表
export const getLiveRelationList = (houseId) => {
  return request({
    url: '/api/smart-xapply/gis/getLiveRelationList',
    method: 'post',
    params: {
      houseId
    }
  })
}

//获取人员特殊人群
export const getSpecialInfo = (id) => {
  return request({
    url: '/api/smart-xapply/gis/getSpecialInfo',
    method: 'post',
    params: {
      id
    }
  })
}

//获取人员基本信息
export const peopleDetail = (id) => {
  return request({
    url: '/api/smart-xapply/gis/peopleDetail',
    method: 'get',
    params: {
      id
    }
  })
}

//
export const selectAllPath = (caseType,type) => {
  return request({
    url: '/api/smart-xapply/gis/selectAllPath',
    method: 'post',
    params: {
      dictCode: caseType,
      dictCodeType: type
    }
  })
}

//获取楼栋详情
export const buildingDetail = (buildingId,buildingUnit,houseNumber) => {
  return request({
    url: '/api/smart-xapply/gis/buildingDetail',
    method: 'get',
    params: {
      id: buildingId,
      buildingUnit,
      houseNumber
    }
  })
}


//
export const getHouseByBuildingRent = (buildingId,buildingUnit,houseNumber) => {
  return request({
    url: '/api/smart-xapply/gis/getHouseByBuildingRent',
    method: 'post',
    params: {
      buildingId
    }
  })
}

//
export const getFocusPeopleCountByBuilding = (buildingId) => {
  return request({
    url: '/api/smart-xapply/gis/getFocusPeopleCountByBuilding',
    method: 'post',
    params: {
      buildingId
    }
  })
}
